|
|
|
|
|
|
|
Figure 12.6.
Adding a second data
control and text control. |
|
|
|
|
|
|
|
|
Save and run the project. This time, select the first item in the list by clicking on it. Now click on the GetList button to bring up the list properties in the text boxes. Force the second data control to save its contents by repositioning the record pointer by clicking the left-most arrow to force the second data set to the first record in the set. You should now see that the second data set, Destination, has been updated by the value in the BoundColumn property of the data-bound list. Your screen should look like the one in Figure 12.6. |
|
|
|
|
|
|
|
|
Do this a few times to add records to the Destination table. Also notice that each time you move the record pointer of the Destination table, the data-bound control reads the value in the bound column and moves the list pointer to highlight the related NameText field. You now have a fully functional data-bound list box! |
|
|
|
|
|
|
|
|
Using the Data-Bound Combo Box |
|
|
|
|
|
|
|
|
The data-bound combo box works very much the same as the data-bound list control. The only difference is the way the data is displayed. The data-bound combo control can be used as a basic data entry text box with added validation. Allowing experienced users to type values they know are correct can speed up the data entry process. Also, new users are able to scan the list of valid entries until they learn them. The data-bound combo is an excellent data entry control. |
|
|
|
|
|
|
|
|
Let's build a new project that shows how you can use the data-bound combo box to create friendly data entry forms. Start a new Visual Basic 5 project. Use Table 12.2 and Figure 12.7 as guides as you build your new form. Save your form as COMBO.FRM and the project as COMBO.VBP. |
|
|
|
|
|